const webpack = require('webpack')
module.exports = {
  publicPath:'/',
  // 取消eslint规则检查
  lintOnSave: false,
  // 跨域
  devServer: {
    open: true,
    host: 'localhost',
    port: '8080',
    historyApiFallback: true,
    proxy: {
      '/api': {
        target: 'https://www.vcanghui.com/',
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  productionSourceMap: false,
  configureWebpack: (config) => {
    if (process.env.NODE_ENV === 'production') {
      config.optimization.minimizer[0].options.terserOptions.compress = {
        drop_console: true
      };
    }
  }
}